#devtools::install_github("quanteda/quanteda") 
#devtools::install_github("koheiw/LSS")

# tokenize
source("tokens.R", local = TRUE)

# apply dictionary
source("dictionary_he.R", local = TRUE)
source("dictionary_ja.R", local = TRUE)

# fit newsmap
source("newsmap_he.R", local = TRUE)
source("newsmap_ja.R", local = TRUE)

# fit LSS
source("lss_he.R", local = TRUE)
source("lss_ja.R", local = TRUE)

rmarkdown::render("lss_he.Rmd")
rmarkdown::render("lss_ja.Rmd")
rmarkdown::render("terms.Rmd")

# validate LSS
rmarkdown::render("validation_he.Rmd")
rmarkdown::render("validation_ja.Rmd")

# regression analysis
source("optimize.R", local = TRUE)
rmarkdown::render("optimize.Rmd")
rmarkdown::render("regression_he.Rmd")
rmarkdown::render("regression_ja.Rmd")

# robustness check
source("bootstrap.R", local = TRUE)
rmarkdown::render("bootstrap.Rmd")

